GBML manual / Collision

box_left

The left edge of this instance’s current collision box, in room pixels - the box `mask_w`/`mask_h`/`mask_x`/`mask_y` (or, failing those, `mask_sprite`/`sprite`) describe, already offset and already in room space.

Syntax

box_left: real (read-only)

Description

Would read back the left edge of this instance's collision mask, in room pixels - one of four read-only edges (box_left, box_right, box_top, box_bottom) that together describe the rectangle collision would test against.

Like x, it is a place in the room, counted from the room's top-left corner: a bigger number is further right.

A sprite with its rectangular collision mask overlaid, showing the left, right, top and bottom edges relative to the instance's x,y origin pointA sprite with its rectangular collision mask overlaid, showing the left, right, top and bottom edges relative to the instance's x,y origin point
A sprite with its rectangular collision mask overlaid, showing the left, right, top and bottom edges relative to the instance's x,y origin point

Collision is not built this engine phase - there is no mask, no bounding box, and no broad-phase grid yet for any of these to test against.

On the GBA

Computed from x/y and whatever the mask currently resolves to, every time it is read) - the same "computed accessor, not a stored field" shape frame_count already uses, not a value that can go stale. These four are the only way to read a mask back in ROOM coordinates; mask_x/mask_y are an offset from the instance, not a position.

See also: mask_spritesolidWhat is unavailable, and why